package com.hehua.web.observer.demo2;

public class Boss {

    private final EventBus eventBus;

    private String action;

    public Boss(EventBus eventBus) {
        this.eventBus = eventBus;
    }

    public void setAction(String action) {
        this.action = action;
        notifyAction();
    }

    public String getAction() {
        return action;
    }

    private void notifyAction(){
        eventBus.publish(new BossActionEvent(action));
    }
}
